<template>
	<view class="newHouse">
		<!-- 搜索 -->
		<searchTop :key='key'></searchTop>
		<!-- 分类 -->
		<view class="cate-section">
			<view class="cate-item" @click="optimization(item)" v-for="(item,index) in cateList" :key="item.id" v-if="index<10">
				<image :src="item.image" mode="aspectFit"></image>
				<view>{{item.name}}</view>
			</view>
		</view>
		<view class="banner">
		   <banner></banner>
		</view>
		<list :goodsList='goodsList'></list>
	</view>
</template>

<script>
	import searchTop from '@/components/searchTop.vue'
	import banner from '@/components/swiper-dot/swiper-dot.nvue'
	import list from '@/components/listHeng.vue'
	export default {
		components: {
			banner,
			list,
			searchTop
		},
		data() {
			return {
				key:{
					placeholder:'搜索 楼盘名/房产名/经纪人'
				},
				cateList: [{
					'image': '../../static/imgs/ic_home_menu_floor_all.png',
					'name': '全部楼盘',
					'url':'newHouseAll'
				}, {
					'image': '../../static/imgs/ic_home_menu_broker_big.png',
					'name': '找经纪人',
					'url':'findAgent'
				}, {
					'image': '../../static/imgs/ic_home_menu_floor_new.png',
					'name': '最新开盘'
				}, {
					'image': '../../static/imgs/ic_home_menu_floor_on.png',
					'name': '在售楼盘'
				}, {
					'image': '../../static/imgs/ic_home_menu_calc_big.png',
					'name': '贷款计算',
					'url':'Calculators'
				}],
				goodsList: [{
					'pid': 1,
					'defaultAlbum': '../../static/imgs/img_mine_bg_vip.png',
					'pName': 'aaa',
					'fSalePrice': '200',
					'iSales': '20'
				},{
					'pid': 1,
					'defaultAlbum': '../../static/imgs/img_mine_bg_vip.png',
					'pName': 'aaa',
					'fSalePrice': '200',
					'iSales': '20'
				},{
					'pid': 1,
					'defaultAlbum': '../../static/imgs/img_mine_bg_vip.png',
					'pName': 'aaa',
					'fSalePrice': '200',
					'iSales': '20'
				},{
					'pid': 1,
					'defaultAlbum': '../../static/imgs/img_mine_bg_vip.png',
					'pName': 'aaa',
					'fSalePrice': '200',
					'iSales': '20'
				}],
			}
		},
		methods:{
			
			optimization(item){
				console.log(item.url)
				uni.navigateTo({
				                 
						 url: item.url
					})
			},
		}
	}
	
</script>

<style scoped lang="scss">
	.newHouse{
		padding: 0 24upx;
		background: #fff;
		
		.cate-section {
			display: flex;
			display: -webkit-flex;
			justify-content: space-between;
			flex-wrap: wrap;
			font-size: 26upx;
			padding: 20upx 0;
		}
		
		.cate-item {
			width: 20%;
			text-align: center;
			margin-top: 40upx;
			font-size: 24upx;
			color: #222;
		
		
		
		}
		
		.cate-item image {
			width: 60upx;
			height: 60upx;
		}
		.banner{
			margin: 20upx 0 60upx 0;
		}
	}
	
</style>
